package com.jlpay.openapi.demo.fund.deferred;

import com.jlpay.open.jlpay.sdk.java.model.fund.deferred.request.FundFlowQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.fund.deferred.response.FundFlowQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chenjunhong
 * @since 2024/12/20
 */
public class FundFlowQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(FundFlowQueryService.class);

    public static void main(String[] args) {
        FundFlowQueryRequest fundFlowQueryRequest = buildFundFlowQueryRequest();
        FundFlowQueryResponse fundFlowQueryResponse = JlpayOpenApiService.openMerchService()
                .post(fundFlowQueryRequest, FundFlowQueryResponse.class);
        LOGGER.info("资金冻结/解冻查询响应:{}", JsonUtils.toString(fundFlowQueryResponse));
    }

    private static FundFlowQueryRequest buildFundFlowQueryRequest() {
        FundFlowQueryRequest fundFlowQueryRequest = new FundFlowQueryRequest();
        fundFlowQueryRequest.setOutOrderId("test_freeze_202412200001");
        return fundFlowQueryRequest;
    }
}
